export default function CreditApi() {
    let _u = uni.$u
    return {
        /**
         * 授信 信息
         * @param {string|number} merchantId 商户ID
         */
        queryCreditInfo: function (merchantId: string | number) {
            return _u.post('/settlement/settlement-bill/querySettlementBillCredit', merchantId, {
                useMask: true
            })
        },
        /**
         * 查询订单记录
         * @param {string|number} billId  账单ID
         */
        queryOrderRecordByID: function (billId: string | number) {
            return _u.post('/settlement/settlement-bill-order/querySettlementBillOrderDetailByBillId', billId, {
                useMask: true
            })
        },
        // 待还金额 & 账单记录
        querySettlementBillManager: function (id: string | number) {
            return _u.post('/settlement/settlement-bill/querySettlementBillManager', id)
        },
        // 还款确认中
        queryRefunding: function (params: object) {
            return _u.post('settlement/settlement-bill-flow/querySettlementBillFlowSumPaidAmountByBillId', params, {
                useMask: true
            })
        },
        // 还款记录
        querySettlementBillFlowByBillId: function (param: object) {
            return _u.post('/settlement/settlement-bill-flow/querySettlementBillFlowByBillId', param, {
                useMask: true
            })
        },
        // 滞纳金信息
        queryDelayMoney: function (param: object) {
            return _u.post('/settlement/settlement-bill/querySettlementBillManagerDetail', param, {
                useMask: true
            })
        },
        // 滞纳金记录
        queryDelayRecords: function (param: object) {
            return _u.post('/settlement/settlement-bill-late-fee/querySettlementBillLateFeeByBillId', param)
        },
        // 查询支付结果
        checkBillPay: function (tradeNo: string | number) {
            return _u.post('/settlement/settlement-bill-flow/checkBillPay', tradeNo)
        }
    }
}
